package com.songxian.wechatcompose.extension

import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.songxian.wechatcompose.ui.theme.WeTheme

/**
 * Created by Administrator on 2021/4/20 0020.
 * Describe:
 */

fun Modifier.unread(read: Boolean, badgeColor: Color): Modifier {
    drawWithContent {
        drawContent()
        if (read)
            drawCircle(
                badgeColor,
                5.dp.toPx(),
                Offset(size.width - 1.dp.toPx(), 1.dp.toPx())
            )
    }
    return this
}